#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
struct ConsoleColor {
    WORD Value;
    ConsoleColor(WORD value) { Value = value; }
    ConsoleColor operator|(const ConsoleColor &Other) const {
        ConsoleColor result = Value;
        result.Value |= Other.Value;
        return result;
    }
    ConsoleColor operator|(const WORD &Other) const {
        ConsoleColor result = Value;
        result.Value |= Other;
        return result;
    }
};

// 支持设置的颜色（目前只有这几种，够用了）
namespace Color {
const ConsoleColor Red = FOREGROUND_RED;               // 红色
const ConsoleColor Green = FOREGROUND_GREEN;           // 绿色
const ConsoleColor Blue = FOREGROUND_BLUE;             // 蓝色
const ConsoleColor Gray = FOREGROUND_INTENSITY;        // 灰色
const ConsoleColor Yellow = Red | Green;               // 黄色
const ConsoleColor Purple = Red | Blue;                // 紫色
const ConsoleColor Aqua = Green | Blue;                // 浅蓝色
const ConsoleColor DefaultColor = Red | Green | Blue;  // 默认颜色（白色）
}  // namespace Color

// 设置颜色
// 用法1：SetColor(Color::Aqua); 这个将颜色设置为了浅蓝色，设置后打印的内容可以变色
// 用法2：cout << SetColor(Color::Green) << 内容; 同“用法1”效果但是更简便
string SetColor(const ConsoleColor &Color) {
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), Color.Value);
    return "";
}
long long num=164212414;
int thing[114],has;
int tim,level,sw,cs,danger,bs=1,amlhas,allend[114514],cj[114514],bsd=20,jl=20,maxchapter,day=0,cn;
char mg[21][21]={
	"#####-######",
	"########--##",
	"#------##-##",
	"#-####-----#",
	"#-##---###-#",
	"#----###-#-#",
	"#-##-###---#",
	"#-##-----#-#",
	"#-####-##--#",
	"#---------##",
	"############"
};
char Aeg[114]={'A','W','A','D','D','S','W','W','W','S','D','S','A','W','S','A','A','D','W','A','A'};
double ti[114]={0,2,3.5,5,7,8,9.5,11,14,16,18,20,23,26,30,32,34,40,45,48,55};
bool jdy[114];
int la=10,mla=0,lb=10,mlb=0;
char hl(char ch){
	if(ch>='a'&&ch<='z'){
		return ch-32;
	}
	else{
		return ch;
	}
}
void CoutStr(const char *p){
	while(1){
		if(*p!=0){
			printf("%c",*p++);
		}
		else{
			break;
		}
		Sleep(20/bs);
	}
	printf("\n");
	Sleep(200/bs); 
	return ;
}
void inal(){
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	system("pause");
	system("cls");
	mciSendString("resume 打字.mp3",NULL,0,NULL);
}
void start(){
	mciSendString("resume 打字.mp3",NULL,0,NULL);
	system("cls");
}
void end(){
	mciSendString("pause 打字.mp3",NULL,0,NULL);
}
void cd(){
	int x=time(0)%1000;
	int y;
	srand(x);
	cout<<x<<" ";
	for(int i=1;i<=19;i++) {
		y=rand()%(127-la);
		while(y<(33-mla)) {
			y=rand()%(127-la);
		}
		cout<<char(allend[i]+y);
	}
	y=rand()%(127-lb);
	while(y<(33-mlb)) {
		y=rand()%(127-lb);
	}
	cout<<char(maxchapter+y);
}
void dd(){
	char ch;
	string str;
	int x;
	cin>>x;
	cin>>str;
	int y;
	srand(x);
	int w=0;
	for(int i=0;i<str.size();i++) {
		y=rand()%(127-la);
		while(y<(33-mla)) {
			y=rand()%(127-la);
		}
		allend[++w]=str[i+1]-y;
	}
	y=rand()%(127-lb);
	while(y<(33-mlb)) {
		y=rand()%(127-lb);
	}
	maxchapter=str[str.size()-1]-y;
}
void Tip(){
	system("cls");
	cout<<"作者：王珺懿（洛谷名：_Q_H_Q_）\n"; 
	mciSendString("play 打字.mp3 repeat",NULL,0,NULL);
	CoutStr("提示：不要多次按键，不要在选项未输出完时按键。 ");
	CoutStr("请选择输出速度倍率（初始40ms/字，输入0至9,0表示无间隔） "); 
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	while(1){
		if(_kbhit()){
			char ch=_getch();
			if(ch>='1'&&ch<='9'){
				bs=ch-'0';
				break;
			}
			else if(ch=='0'){
				bs=200;
				break;
			}
		}
	}
	CoutStr("设置完成。"); 
	system("pause");
} 
void chapter0();
void chapter1();
void chapter2();
void man(){
	start();
	CoutStr("主菜单");
	CoutStr("A.输出当前的结局。");
	CoutStr("B.输出当前的成就。");
	CoutStr("C.读档");
	CoutStr("D.退出");
	CoutStr("E.鸣谢名单");
	CoutStr("F.存档");
	CoutStr("G.跳章节");
	CoutStr("记住：在危难时刻大喊伟大的作者先森，救救我吧！ ");
	end();
	int num;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			num=0;
			if(ch=='A'){
				start();
				CoutStr("第一章结局：");
				CoutStr("坏结局："); 
				if(allend[1]==1){
					num++;
					CoutStr("END 1:不要破坏公物。——结局已达成。");
				}
				else{
					CoutStr("END 1:不要破坏公物。——结局未达成。");
				}
				if(allend[2]==1){
					num++;
					CoutStr("END 2:是食物有问题吗？还是......没遵守规则呢？——结局已达成。");
				}
				else{
					CoutStr("END 2:是食物有问题吗？还是......没遵守规则呢？——结局未达成。");
				}
				if(allend[3]==1){
					num++;
					CoutStr("END 3:美好的死亡......吗？——结局已达成。");
				}
				else{
					CoutStr("END 3:美好的死亡......吗？——结局未达成。");
				}
				if(allend[4]==1){
					num++;
					CoutStr("END 4:不要太相信自己的直觉——结局已达成。");
				}
				else{
					CoutStr("END 4:不要太相信自己的直觉——结局未达成。");
				}
				if(allend[5]==1){
					num++;
					CoutStr("END 5:认知滤网下，是什么呢？——结局已达成。");
				}
				else{
					CoutStr("END 5:认知滤网下，是什么呢？——结局未达成。");
				}
				if(allend[6]==1){
					num++;
					CoutStr("END 6:辟谷——结局已达成。");
				}
				else{
					CoutStr("END 6:辟谷——结局未达成。");
				}
				if(allend[7]==1){
					num++;
					CoutStr("END 7:007加班——结局已达成。");
				}
				else{
					CoutStr("END 7:007加班——结局未达成。");
				}
				if(allend[8]==1){
					num++;
					CoutStr("END 8:不要作死——结局已达成。");
				}
				else{
					CoutStr("END 8:不要作死——结局未达成。");
				}
				if(allend[10]==1){
					num++;
					CoutStr("END 10:密码错误——结局已达成。");
				}
				else{
					CoutStr("END 10:密码错误——结局未达成。");
				}
				if(allend[12]==1){
					num++;
					CoutStr("END 12:真假难辨——结局已达成。");
				}
				else{
					CoutStr("END 12:真假难辨——结局未达成。");
				}
				if(allend[14]==1){
					num++;
					CoutStr("END 14:棋差一着——结局已达成。");
				}
				else{
					CoutStr("END 14:棋差一着——结局未达成。");
				}
				CoutStr("好结局："); 
				if(allend[9]==1){
					num++;
					CoutStr("END 9:生还之......——结局已达成。");
				}
				else{
					CoutStr("END 9:生还之.......——结局未达成。");
				}
				if(allend[11]==1){
					num++;
					CoutStr("END 11:杀神——结局已达成。");
				}
				else{
					CoutStr("END 11:杀神——结局未达成。");
				}
				if(allend[13]==1){
					num++;
					CoutStr("END 13:职业侦探——结局已达成。");
				}
				else{
					CoutStr("END 13:职业侦探——结局未达成。");
				}
				CoutStr("真结局：");
				if(allend[15]==1){
					num++;
					CoutStr("END 15:斩断循环——结局已达成。");
				}
				else{
					CoutStr("END 15:???——结局未达成。");
				}
				CoutStr("彩蛋结局：");
				if(allend[19]==1){
					num++;
					CoutStr("END -1:我是你爹~——结局已达成。");
				}
				else{
					CoutStr("END -1:???——结局未达成。");
				}
				CoutStr("第二章结局：");
				CoutStr("坏结局："); 
				if(allend[16]==1){
					num++;
					CoutStr("END 16:礼貌也会过时——结局已达成。");
				}
				else{
					CoutStr("END 16:礼貌也会过时——结局未达成。");
				}
				if(allend[17]==1){
					num++;
					CoutStr("END 17:礼貌至极。——结局已达成。");
				}
				else{
					CoutStr("END 17:礼貌至极。——结局未达成。");
				}
				if(allend[18]==1){
					num++;
					CoutStr("END 18:真·笑死我了——结局已达成。");
				}
				else{
					CoutStr("END 18:真·笑死我了——结局未达成。");
				}
				if(allend[20]==1){
					num++;
					CoutStr("END 19:哪里有路？——结局已达成。");
				}
				else{
					CoutStr("END 19:哪里有路？——结局未达成。");
				}
				if(allend[21]==1){
					num++;
					CoutStr("END 20:你是人类吗？——结局已达成。");
				}
				else{
					CoutStr("END 20:你是人类吗？——结局未达成。");
				}
				if(allend[22]==1){
					num++;
					CoutStr("END 21:陌生人的东西你也敢要？——结局已达成。");
				}
				else{
					CoutStr("END 21:陌生人的东西你也敢要？——结局未达成。");
				}
				if(allend[23]==1){
					num++;
					CoutStr("END 22:别打断我！——结局已达成。");
				}
				else{
					CoutStr("END 22:别打断我！——结局未达成。");
				}
				if(num==23){
					CoutStr("恭喜！当前全结局收集完成！");
					CoutStr("感谢您玩我的游戏！");
					CoutStr("如果对后面的章节有想法或者想投角色的，欢迎luogu.com.cn私信zjw806903!"); 
				}
				inal();
				man();
			}
			else if(ch=='B'){
				start();
				if(cj[1]==1){
					num++; 
					CoutStr("天命之子——成就已完成。");
				}
				else{
					CoutStr("天命之子——成就未完成。");
				}
				if(cj[2]==1){
					num++;
					CoutStr("我就是Ayin本人——成就已完成。");
				}
				else{
					CoutStr("我就是Ayin本人——成就未完成。");
				}
				if(cj[3]==1){
					num++;
					CoutStr("你被骗了——成就已完成。");
				}
				else{
					CoutStr("你被骗了——成就未完成。");
				}
				if(cj[4]==1){
					num++;
					CoutStr("数学大师——成就已完成。");
				}
				else{
					CoutStr("数学大师——成就未完成。");
				}
				if(cj[5]==1){
					num++;
					CoutStr("国粹学家——成就已完成。");
				}
				else{
					CoutStr("国粹学家——成就未完成。");
				}
				if(cj[6]==1){
					num++;
					CoutStr("*国警察——成就已完成。");
				}
				else{
					CoutStr("*国警察——成就未完成。");
				}
				if(cj[7]==1){
					num++;
					CoutStr("斩断循环之人——成就已完成。");
				}
				else{
					CoutStr("???——成就未完成。");
				}
				if(cj[8]==1){
					num++;
					CoutStr("职业外交官——成就已完成。");
				}
				else{
					CoutStr("职业外交官——成就未完成。");
				}
				if(num==8){
					CoutStr("恭喜！当前全成就收集完成！");
					CoutStr("感谢您玩我的游戏！");
					CoutStr("如果对后面的章节有想法或者想投角色的，欢迎luogu.com.cn私信_Q_H_Q_!"); 
				}
				inal();
				man();
			}
			else if(ch=='C'){
				start();
				CoutStr("请输入您的存档文件。"); 
				dd();
				inal();
				man();
			}
			else if(ch=='D'){
				chapter0();
			}
			else if(ch=='E'){
				start();
				CoutStr("特别鸣谢：");
				CoutStr("@_Q_H_Q_ (写个自己不过分吧)完成了整个游戏的制作。");
				CoutStr("@1_plus_1_equal_5 提出了中量游戏中存在的BUG。");
				CoutStr("@tangtingwei 提出了中量游戏中存在的BUG，写了游戏攻略。");
				CoutStr("@Leaf59 提出了大量游戏中存在的BUG（大贡献）。");
				CoutStr("@yinzifan 提出了中量游戏中存在的BUG。");
				CoutStr("@cuitenglong 写了游戏攻略。");
				CoutStr("@guanyue7109 对游戏提出了优化建议，写了游戏的存档系统（重大贡献）。");
				CoutStr("你 支持游戏（重大贡献）"); 
			}
			else if(ch=='F'){
				start();
				CoutStr("存档已完成，即将退出游戏，再次开始游戏时输入下方字符串即可。");
				cd();
				end();
				Sleep(5000);
				exit(0);
			}
			else if(ch=='G'){
				CoutStr("请输入数字以跳至对应章节：");
				while(1){
					if(_kbhit()){
						char ch=_getch();
						ch=hl(ch);
						if(ch=='0'){
							chapter0();
						}
						else if(ch=='1'&&maxchapter>=1){
							chapter1();
						}
						else if(ch=='2'&&maxchapter>=2){
							chapter2();
						}
					}
				}
			}
		}
	}
}
void chapter0(){
	Tip();
	start();
	CoutStr("是否进入主菜单？（可以看收集的结局,成就,读档等）");
	CoutStr("A.是");
	CoutStr("B.否");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				man();
			}
			else if(ch=='B'){
				break;
			}
		}
	}
	start();
	system("cls");
	CoutStr("序章 误入歧途");
	inal();
	CoutStr("你正在路上走着，一辆车飞驰而来，你妄图躲避，却还是被车一头创上。");
	inal();
	CoutStr("你听着耳边嘈杂的人声，一生的画面如同走马灯般掠过。");
	CoutStr("难道，我就这样死了吗？你想。");
	CoutStr("你逐渐失去了意识。");
	inal();
	CoutStr("等你再睁开眼时，你已经来到了一个陌生的地方。");
	inal();
	CoutStr("一个声音告诉你，只要能通过它给出的所有“关卡”，便能重获生命，回到社会。");
	CoutStr("而且，还能向它许下一个愿望，只要在它的能力范围之内，都可以实现。 ");
	CoutStr("你虽不情不愿，死了都要被人拉来做这种事，但是“复活”与“愿望”吸引了你。");
	CoutStr("“反正都死了，试一试也未必不可。” ");
	inal();
	CoutStr("那就开始吧，如果我没记错的话，这应该是第......");
	cout<<"             "<<num<<endl;
	Sleep(1000);
	CoutStr("   次了吧。");
	inal();
	CoutStr("未待你仔细思考这句话，那个声音便消失了。"); 
	CoutStr("等你再抬头时，眼前出现了一个建筑物，看起来似乎是一个巨大的商场。");
	CoutStr("你意识到你可以移动了。 ");
	inal();
	chapter1();
	return ;
}
void egg1(){
	for(int i=1;i<=3;i++){
		CoutStr("我是你爹~ ");
	}
	CoutStr("你大声喊道。");
	CoutStr("Angela愣了一下。(内心：CNM)");
	CoutStr("趁着这个瞬间，你给了她一枪。");
	CoutStr("谁也想不到Angela会以这样的方式死亡。");
	CoutStr("END -1:我是你爹~"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	CoutStr("C.下一章。");
	end();
	allend[19]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
			else if(ch=='C'){
				chapter2();
			}
		}
	}
}
void end1(){
	start();
	CoutStr("你越撕，身体越痛，当你将规则完全撕下时，你的身体裂成了两半。");
	CoutStr("END 1:不要破坏公物。");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	allend[1]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end2(){
	start();
	CoutStr("你带走了食物，可是，过了一会，你身上出现了食物中毒的症状，你死了。");
	CoutStr("END 2:是食物有问题吗？还是......没遵守规则呢？");
	allend[2]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end3(){
	start();
	CoutStr("你死了。走得很安详。");
	CoutStr("END 3:美好的死亡......吗？");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	allend[3]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end4(){
	start();
	CoutStr("你走入了一片黑暗。");
	CoutStr("你迷失了方向。");
	CoutStr("你饿死了。");
	Sleep(9000); 
	CoutStr("END 4:不要太相信自己的直觉");
	allend[4]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end5(){
	start();
	CoutStr("兔子这么可爱，怎么能不摸呢？");
	CoutStr("你生出了这样的想法。");
	CoutStr("你摸了摸兔子。");
	CoutStr("你变成了兔子。");
	CoutStr("END 5:认知滤网下，是什么呢？");
	allend[5]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end6(){
	start();
	CoutStr("你饿死了。");
	CoutStr("END 6:辟谷");
	allend[6]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end(); 
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
} 
void end7(){
	start();
	CoutStr("你累死了。");
	CoutStr("END 7:007加班");
	allend[7]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end(); 
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end8(){
	start();
	Sleep(9000); 
	CoutStr("你刚踏入这一层，一股侵蚀力量将你当场抹除。");
	CoutStr("END 8:不要作死");
	allend[8]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end(); 
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end9(){
	start();
	CoutStr("你离开了商场。");
	CoutStr("你心(lian)有(lian)余(bu)悸(she)的回头看了一眼，商场除了没有人之外显得那么正常。");
	CoutStr("你连忙跑离了商场，你发誓，绝对想再来一次。"); 
	CoutStr("END 9:生还之......");
	allend[9]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	CoutStr("C.下一章。");
	end(); 
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
			else if(ch=='C'){
				chapter2();
			}
		}
	}
}
void end1_2(){
	start();
	CoutStr("你把门踹开了。");
	CoutStr("你的身体出现了一个大洞。"); 
	CoutStr("END 1:不要破坏公物。");
	thing[16]++;
	if(thing[16]>=3&&!cj[6]){
		CoutStr("你说说你，怎么就喜欢踹门呢？");
		cj[6]=1;
		CoutStr("获得成就：*国警察");
	}
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	end();
	allend[1]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end10(){
	start();
	CoutStr("随着一声密码错误，你坠入了无底深渊。");
	CoutStr("END 10:密码错误"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[10]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end11(){
	start();
	CoutStr("END 11:杀神"); 
	allend[11]=1;
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	CoutStr("C.下一章。");
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
			else if(ch=='C'){
				chapter2();
			}
		}
	}
}
void end12(){
	start();
	CoutStr("不知为何，当你说完这句话后，游客的身体扭曲了。");
	CoutStr("看来，你不属于......“它”隐约挤出一句话。");
	CoutStr("在一瞬间，你的记忆被清空了。");
	CoutStr("我要干嘛来着，哦，我要去买菜。"); 
	CoutStr("END 12:真假难辨"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[12]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end13(){
	start();
	CoutStr("他听完，像是什么都没发生一样走了。");
	CoutStr("你意识到现实中不可能有这种情况。");
	CoutStr("你意识到自己进入了幻境。");
	CoutStr("眼前幻境破碎。"); 
	CoutStr("提示音响起：恭喜，通关成功。"); 
	CoutStr("END 13:职业侦探");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	CoutStr("C.下一章。"); 
	allend[13]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
			else if(ch=='C'){
				chapter2();
			}
		}
	}
}
void end14(){
	CoutStr("你死了。");
	CoutStr("END 14:棋差一着");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[14]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end15(){
	CoutStr("好机会！就是现在！");
	CoutStr("B喊道。");
	CoutStr("你拿出玩具刀，狠狠地朝Angela挥过去。");
	CoutStr("你抽出玩具枪，连射几枪，Angela倒在了地上。");
	CoutStr("B的身影变的虚幻。");
	CoutStr("感谢你......外来者......循环被打破了......我的任务也就结束了......祝你.......一路顺风......");
	CoutStr("你想说两句，用手去抓他的身影。");
	CoutStr("可他已经走了。");
	CoutStr("恭喜玩家通关真结局：斩断循环。");
	CoutStr("恭喜玩家获得成就：斩断循环之人。");
	CoutStr("呵......游戏吗......又是谁的呢？");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	CoutStr("C.下一章。");
	cj[7]=1;
	allend[15]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
				exit(0);
			}
			else if(ch=='B'){
				exit(0);
			}
			else if(ch=='C'){
				chapter2();
			}
		}
	}
}
void end16(){
	start();
	CoutStr("“布什戈门，你TM装NM清高呢？给爷死！”售票员说。");
	CoutStr("你被售票员一刀秒了。");
	CoutStr("END 16:礼貌也会过时。"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[16]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end17(){
	start();
	CoutStr("“你TM敢骂我？”售票员十分生气，给了你一刀。");
	CoutStr("你被一刀捅死了。");
	CoutStr("END 17:礼貌至极。"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[17]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end18(){
	start();
	CoutStr("“你还笑是吧，给爷死！”售票员说。");
	CoutStr("你被一刀捅死了。");
	CoutStr("END 18:真·笑死我了"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[18]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end19(){
	start();
	CoutStr("你一脚踏入虚空。");
	CoutStr("你死了。");
	CoutStr("END 19:哪里有路？"); 
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[20]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end20(){
	start();
	CoutStr("“看来这下就没问题了。你过来吧。”售票员表情缓和了下来。");
	CoutStr("你慢慢走了过去，却没想到......");
	CoutStr("售票员猛然跳起，一刀抹了你的喉，嘴里大喊：“去死吧，怪物！”");
	CoutStr("你死了。");
	CoutStr("END 20:你是人类吗?");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[21]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end21(){
	start();
	CoutStr("你死了。死因中毒。");
	CoutStr("END 21:陌生人的东西你也敢要？");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[22]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void end22(){
	start();
	CoutStr("“打断者......死......!”天空飘来一阵声音。");
	CoutStr("你死了。");
	CoutStr("END 22:别打断我！");
	CoutStr("A.重新开始。");
	CoutStr("B.退出游戏。");
	allend[23]=1;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				num++;
				chapter0();
			}
			else if(ch=='B'){
				exit(0);
			}
		}
	}
}
void Get_Time(){
	if(level==6){
		CoutStr("时间静止了。");
		inal();
		return ;
	}
	tim-=30;
	if(tim%100>=60){
		if(level==2){
			jl-=2;
			danger++;
		}
		tim-=40;
	}
	if(tim<=-1){
		tim+=2400;
		day--;
	}
	cout<<"当前时间："<<tim/100<<"时"<<tim%100<<"分。";
	if(thing[2]!=-1){
		thing[2]++;
	}
	inal(); 
}
void Get_Level(){
	tim-=30;
	if(tim%100>=60){
		if(level==2){
			jl-=2;
			danger++;
		}
		tim-=40;
	}
	if(tim<=-1){
		tim+=2400;
		day--;
	}
	cout<<"当前楼层："<<level<<"层。";
	Sleep(500);
	if(thing[1]&&thing[1]!=level){
		CoutStr("你意识到这里的空间有些问题。");
		thing[1]=-1;
	}
	else{
		thing[1]=level;
	}
	inal();
}
void chos3(){
	int number=rand()%10;
	if(number<=4){
		CoutStr("什么都没有。");
		inal();
	}
	if(number==5||number==6||number==7||number==8){
		CoutStr("你找到了一些食物。");
		sw++;
		inal(); 
	}
	if(number==9){
		CoutStr("你找到了一个钟，上面显示时间为11:45分。");
		if(thing[2]){
			CoutStr("你意识到这里的时间有些问题。");
			thing[2]=-1;
		}
		inal(); 
	}
}
void question1(int lx){
	start();
	if(lx==1){
		CoutStr("他四处看看，确定没人后告诉你：");
		CoutStr("不该问的事少问！");
		danger++;
		inal();
		return ;
	}
	else if(lx==2){
		if(cs){
			CoutStr("这个吗......虽然不想告诉你，但是确实有问题。");
			cs--;
			inal();
		}
		else{
			CoutStr("没有回答。");
			danger+=2;
			inal();
		}
		return ;
	}
	else if(lx==3){
		if(thing[8]==-1){
            cj[3]=1;
			mciSendString("play 你被骗了.mp3",NULL,0,NULL);
			CoutStr("你 被 骗 了！");
			CoutStr("你失去了玩具剑。");
			CoutStr("获得成就：你被骗了。");
			thing[8]=0;
			inal();
			mciSendString("close 你被骗了.mp3",NULL,0,NULL);
			mciSendString("play 打字.mp3 repeat",NULL,0,NULL);
		}
		else{
			CoutStr("没有回答。");
			danger+=5;
			inal();
		}
		return ;
	}
	else{
		CoutStr("没有回答。");
		danger+=5;
		inal();
		return ;
	}
}
void Level1();
void Level2();
void Level3();
void Level4();
void Level5();
void Level6();
void ask(int lx){
	start();
	CoutStr("你决定向他询问：");
	CoutStr("A.对不起打扰了。");
	if(thing[1]==-1){
		CoutStr("B.这里的空间是有问题吗？");
	}
	if(thing[2]==-1){
		CoutStr("C.这里的时间是有问题吗？");
	}
	if(danger>=3){
		CoutStr("D.我感觉有些烦躁。");
	}
	if(lx==4){
		CoutStr("E.你是谁？");
	}
	if(thing[8]==-1){
		CoutStr("F.(拿出玩具剑砍向他)");
	}
	if(thing[13]==-1){
		CoutStr("G.(拿出玩具枪给他一枪)");
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				break;
			}
			else if(ch=='B'&&thing[1]==-1){
				question1(lx);
				break;
			}
			else if(ch=='C'&&thing[2]==-1){
				question1(lx);
				break;
			}
			else if(ch=='D'&&danger>=3){
				start();
				CoutStr("没有回答。");
				inal();
				danger+=3;
				break;
			}
			else if(ch=='E'&&lx==4){
				if(thing[5]==-1){
					CoutStr("我是B，就是入口的第二个红色字迹，这里有问题，快去T5!来不及了!");
					CoutStr("你身上“B”给的信物消失了。");
					inal();
					thing[5]=0;
				}
				else{
					CoutStr("没有回答。");
					inal();
					danger+=5;
				}
				break;
			}
			else if(ch=='F'&&thing[8]==-1){
				CoutStr("他一脸震惊地看向你，倒在了血泊中。");
				CoutStr("你拿着刀，将这的人杀了大半。");
				CoutStr("你脚下突然出现了一个传送门，将你传到了其他地方。");
				CoutStr("走之前，你隐隐听到一句话：“TM的这个人是有冰吧！”");
				inal(); 
				end11(); 
			}
			else if(ch=='G'&&thing[13]==-1){
				CoutStr("他一脸震惊地看向你，倒在了血泊中。");
				CoutStr("你拿着枪，将这的人杀了大半。");
				CoutStr("你脚下突然出现了一个传送门，将你传到了其他地方。");
				CoutStr("走之前，你隐隐听到一句话：“TM的这个人是有冰吧！”");
				inal(); 
				end11(); 
			}
		}
	}
	return ;
}
void help(int lev){
	start();
	int num=rand()%100,lx=0;
	if(num<=40){
		CoutStr("可是并没有人。");
		inal(); 
	}
	if(num<=60){
		lx=1;
		CoutStr("你遇到了一名蓝衣IOI工作人员。");
		inal(); 
		CoutStr("他向你询问：请问您需要帮助吗？");
		inal(); 
	}
	else if(num<=70){
		lx=2;
		CoutStr("你遇到了一名蓝衣IOI委员会主席。");
		inal(); 
	}
	else if(num<=80){
		lx=3;
		CoutStr("你遇到了一名红衣IOI委员会会长。");
		inal(); 
	}
	else if(num<=85){
		CoutStr("你遇到了一名蓝衣IOI委员会会长。");
		inal(); 
	}
	else if(num<=90){
		CoutStr("你遇到了一名红衣IOI工作人员。");
		inal();
		CoutStr("他向你询问：请问您需要帮助吗？"); 
		inal(); 
	}
	else if(num<=95){
		CoutStr("你遇到了一名红衣IOI委员会主席。");
		inal(); 
	}
	else if(num<=100){
		lx=4;
		CoutStr("你遇到了？？？");
		inal(); 
	}
	ask(lx);
	if(lev==2){
		Level2();
	}
	else if(lev==1){
		Level1();
	}
	else if(lev==3){
		Level3();
	}
	else if(lev==4){
		Level4();
	}
}
void Level1();
void atk(){
	start();
	CoutStr("你刚离开迷宫，Angela站在你面前，一把剑朝你挥来，你险之又险的避开了。");
	CoutStr("身后的迷宫轰然倒塌，你没有退路了。");
	CoutStr("*你充满了决心");
	CoutStr("规则简述：B 会给出Angela的攻击，你需要在1.5s内格挡，请按照相反方向格挡。wasd操作。（不是决心鱼）");
	inal();
	clock_t cp=clock();
	int now=1,poi=0;
	while(1){
		clock_t t=clock();
		double tim=(t-cp)/CLOCKS_PER_SEC;
		if(now>20){
			break;
		}
		if(tim>=ti[now]&&!jdy[now]){
			if(tim-ti[now]>1.5){
				CoutStr("你被Angela一刀砍中。");
				inal(); 
				end14();
			}
			if(!poi){
				system("cls");
				cout<<Aeg[now];
				poi=1;
			}
		}
		else{
			continue;
		}
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(tim>=ti[now]&&now==8&&ch=='B'){
				egg1();
			} 
			if(tim>=ti[now]&&ch=='W'){
				if(Aeg[now]=='S'){
					poi=0;
					now++;
					system("cls");
				}
				else{
					CoutStr("你被Angela一刀砍中。");
					inal(); 
					end14();
				}
			}
			else if(tim>=ti[now]&&ch=='S'){
				if(Aeg[now]=='W'){
					poi=0;
					now++;
					system("cls");
				}
				else{
					CoutStr("你被Angela一刀砍中。");
					inal(); 
					end14();
				}
			}
			else if(tim>=ti[now]&&ch=='A'){
				if(Aeg[now]=='D'){
					poi=0;
					now++;
					system("cls");
				}
				else{
					CoutStr("你被Angela一刀砍中。");
					inal(); 
					end14();
				}
			}
			else if(tim>=ti[now]&&ch=='D'){
				if(Aeg[now]=='A'){
					poi=0;
					now++;
					system("cls");
				}
				else{
					CoutStr("你被Angela一刀砍中。");
					inal(); 
					end14();
				}
			}
		}
	}
	end15();
}
void aft(){
	tim+=30;
	if(tim%100>=60){
		tim+=40;
	}
	if(tim>=2400){
		tim-=2400;
		day++;
	}
}
void puzzle(){
	CoutStr("规则简述：");
	CoutStr("wasd移动，我将会在屏幕上显示那些可以移动，形如：可移动：ws等");
	inal();
	cn=20;
	int x=1,nx,ny=6;
	while(cn--){
		nx=11-x-1;
		start();
		CoutStr("可移动：");
		if(mg[nx-1][ny]=='-'){
			cout<<"w";
		}//8 5
		if(mg[nx][ny-1]=='-'){
			cout<<"a";
		}
		if(mg[nx+1][ny]=='-'){
			cout<<"s";
		}
		if(mg[nx][ny+1]=='-'){
			cout<<"d";
		}
		cout<<endl<<"剩余步数："<<cn<<endl;
		if(nx==2&&ny==5){
			CoutStr("听我的，破墙一脚踹了！往前冲就完了！我可以挡一次规则，这根本没出口！");
		}
		if(nx==0&&ny==5){
			break;
		}
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='W'&&((mg[nx-1][ny]=='-')||(nx==2&&ny==5))){
					x++;
					break;
				}
				else if(ch=='S'&&mg[nx+1][ny]=='-'){
					x--;
					break;
				}
				else if(ch=='A'&&mg[nx][ny-1]=='-'){
					ny--;
					break;
				}
				else if(ch=='D'&&mg[nx][ny+1]=='-'){
					ny++;
					break;
				}
			}
		}
	}
	if(cn<=0){
		CoutStr("迷宫轰然倒塌。");
		inal(); 
		end14();
	}
	else{
		atk(); 
	}
}
void Level0(){
	start();
	inal();
	if(thing[8]!=-1||thing[13]!=-1||thing[15]!=-1){
		end8();
	}
	SetColor(Color::Red);
	CoutStr("Angela正悬浮在你面前。");
	CoutStr("你不知道她是怎么飞起来的，也不知道她在想什么。");
	CoutStr("“你再一次破坏了A的计划。”Angela说。");
	CoutStr("未待你思考“再一次什么意思，Angela将你关在了一个迷宫中。”");
	CoutStr("眼前，不得破坏公物的规则闪闪发光。");
	CoutStr("你身旁的B有些震惊：你是怎么改变规则的？");
	SetColor(Color::DefaultColor);
	CoutStr("一个迷宫从地下升起，将你困在里面。");
	cn=20; 
	CoutStr("周围迷宫的墙壁侵蚀着你，你的时间不多了。"); 
	inal();
	puzzle();
}
void Level1(){
	level=1;
	start();
	CoutStr("你决定：");
	CoutStr("A.搜寻附近。");
	CoutStr("B.看看这是几楼。");
	CoutStr("C.前往楼下。");
	CoutStr("D.前往楼上。");
	CoutStr("E.看看时间。");
	CoutStr("F.寻求帮助。");
	if(day>=3&&!thing[3]){
		thing[3]=-1;
		CoutStr("你发现这一层多出了一扇大门。");
	}
	if(day>=3){
		CoutStr("G.逃出去。");
	}
	tim+=30;
	bsd--;
	jl--;
	if(jl<=-1){
		end7();
	}
	if(bsd<=-1){
		end6();
	}
	if(bsd<=5){
		CoutStr("你快要饿死了。"); 
	}
	else if(bsd<=10){
		CoutStr("你感觉很饿。"); 
	}
	if(jl<=5){
		CoutStr("你快要累死了。");
	}
	else if(jl<=10){
		if(jl%3==0){
			danger++;
		}
		CoutStr("你累了。");
	}
	if(tim%100>=60){
		if(amlhas){
			amlhas++;
		}
		tim+=40;
	}
	if(tim/100>=24){
		tim-=2400;
		day++;
	}
	if(danger>=3){
		CoutStr("一些烦躁的情绪出现在你心里。");
		thing[9]=-1; 
	}
	if(danger>=7){
		int animal=rand()%max((100-danger*5),1);
		if(animal<=5){
			CoutStr("你看见了兔子。");
			amlhas=1; 
		}
	}
	if(amlhas>=5){
		end5();
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos3();
				Level1();
			}
			else if(ch=='B'){
				Get_Level();
				Level1();
			}
			else if(ch=='C'){
				Level2();
				break;
			}
			else if(ch=='D'){
				Level0();
				break;
			}
			else if(ch=='E'){
				Get_Time();
				Level2();
			}
			else if(ch=='F'){
				help(1);
			} 
			else if(ch=='G'&&day>=3){
				end9();
			}
		}
	}
}
void Level2(){
	level=2;
	jl--;
	bsd--;
	start();
	CoutStr("你决定：");
	CoutStr("A.搜寻附近。");
	CoutStr("B.看看这是几楼。");
	CoutStr("C.前往楼下。");
	CoutStr("D.前往楼上。");
	CoutStr("E.看看时间。");
	CoutStr("F.寻求帮助。");
	if(sw){
		CoutStr("G.吃点东西"); 
	}
	
	tim+=30;
	if(jl<=-1){
		end7();
	}
	if(bsd<=-1){
		end6();
	}
	if(bsd<=5){
		CoutStr("你快要饿死了。"); 
	}
	else if(bsd<=10){
		CoutStr("你感觉很饿。"); 
	}
	if(jl<=5){
		CoutStr("你快要累死了。");
	}
	else if(jl<=10){
		if(jl%3==0){
			danger++;
		}
		CoutStr("你累了。");
	}
	if(tim%100>=60){
		danger--;
		if(danger==2){
			CoutStr("你不在烦躁了。");
			thing[9]=0;
		}
		if(danger==6){
			CoutStr("兔子消失了，就像他从没来过。");
			amlhas=0;
		}
		jl+=4;
		tim+=40;
	}
	if(tim/100>=24){
		tim-=2400;
		day++;
	}
	if(danger>=3){
		CoutStr("一些烦躁的情绪出现在你心里。");
		thing[9]=0;
	}
	if(danger>=7){
		int animal=rand()%max((100-danger*5),1);
		if(animal<=5){
			CoutStr("你看见了兔子。");
			amlhas=1; 
		}
	}
	if(amlhas>=5){
		end5();
		return ;
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos3();
				Level2();
			}
			else if(ch=='B'){
				Get_Level();
				Level2();
			}
			else if(ch=='C'){
				Level3();
				break;
			}
			else if(ch=='D'){
				Level1();
				break;
			}
			else if(ch=='E'){
				Get_Time();
				Level2();
			}
			else if(ch=='F'){
				help(2);
			}
			else if(ch=='G'&&sw){
				sw--;
				bsd+=5;
				Level2();
			}
		}
	}
}
void chos6();
void paper1(){
	start(); 
	CoutStr("某人的“信物”");
	CoutStr("听好了，不知何处的OIER，我不知你是怎么来到的IOI，但是，我将向你说一些内容，你可能无法理解或者怀疑，但是我希望你相信。");
	CoutStr("先自我介绍一下，我叫本杰明，他们都叫我“B”，这个地方的“管理者”是一个仿照“C”制作的机器人，名叫“Angela”。");
	CoutStr("这里的所有人都被Angela控制了，所以以后出现的“我”都是被他控制的。");
	CoutStr("红色的规则，呃，不如说是血色的规则是我写的，当然，也有可能是Angela用我的血写的，只有我的血有这个能力......");
	CoutStr("真正的出口在T6，希望你能相信我。");
	CoutStr("真正的出口在T1，希望你能相信我。");
	CoutStr("注意你的“危险值”，他不会显示，但当你做出错误的选择时，他会累加，你可以到Leavl2消除。");
	CoutStr("最后，希望你能找到Angela，这里，是逃不出去的......");
	CoutStr("这些话可能被篡改，注意分辨。");
	CoutStr("A.收起来。");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos6();
			}
		}
	}
}
void chos4();
void chos7();
void chos8(){
	start();
	if(!thing[5]){
		thing[5]=-1;
		jl--;
		CoutStr("你翻出了一张纸条，纸条埋的很深，使你找了很久。");
		CoutStr("纸条看起来有些陈旧，你决定：");
		CoutStr("A.读读看。");
		CoutStr("B.收起来。");
		CoutStr("C.丢了。");
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'){
					paper1();
				}
				else if(ch=='B'){
					chos6();
				}
				else if(ch=='C'){
					thing[5]=0;
					chos6();
				}
			}
		}
	}
	else{
		CoutStr("什么也没有。");
		end();
		chos6();
	}
}
void chos6(){
	start();
	if(thing[6]==-1){
		CoutStr("你遇见了你的亲人。");
		CoutStr("这是如此巧合，使你信不了一点。"); 
		CoutStr("他们呼唤着你：快走，孩子，我知道这个啥啥商场给了一堆规则，可这都是迷信啊！");
		CoutStr("我们找到出口了，你想在里面过夜吗？"); 
	}
	CoutStr("你翻找着一家店铺里的东西，可是什么都没有。");
	if(thing[6]==-1){
		CoutStr("亲人的喊声使你心烦意乱。");
	}
	CoutStr("你决定："); 
	CoutStr("A.回去。");
	CoutStr("B.继续找。");
	if(thing[6]==-1){
		CoutStr("C.跟着家人去寻找出口。");
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				if(thing[6]==-1){
					thing[6]=0;
				} 
				chos4();
			}
			else if(ch=='B'){
				if(thing[6]==-1){
					thing[6]=0;
				}
				chos8();
			}
			else if(ch=='C'&&thing[6]==-1){
				danger+=4;
				chos7();
			}
		}
	}
} 
void chos7(){
	if(danger>=5){
		start();
		CoutStr("啊！瞧瞧我看见了什么！出口！我来了！你决定：");
		CoutStr("A.出去！");
		CoutStr("B.出去！");
		CoutStr("C.出去！");
		CoutStr("作者提示：玩过脑叶公司吗？经典3选1，你说结局是啥？");
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'||ch=='B'||ch=='C'){
					end3();
				}
			}
		}
	}
	else{
		start();
		CoutStr("前方是一个巨物的嘴，你光看了一眼，便冷汗直流。你决定：");
		danger+=4;
		CoutStr("A.快跑！");
		CoutStr("B.快跑！");
		CoutStr("C.快跑！");
		jl-=3; 
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'||ch=='B'||ch=='C'){
					CoutStr("你一口气跑回了T3。");
					Level3();
				}
			}
		}
		
	} 
} 
void chos5(){
	CoutStr("你愈发深入了这一楼。");
	if(danger>=5){
		CoutStr("你觉得前方愈发光明。");
	}
	else{
		CoutStr("你觉得前方愈发黑暗。");
	}
	CoutStr("你决定：");
	CoutStr("A.继续向前");
	CoutStr("B.回去");
	if(danger<=1){
		CoutStr("C.搜索一下");
	}
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos7();
			}
			else if(ch=='B'){
				chos4();
			}
			else if(ch=='C'&&danger<=1){
				chos6();
			}
		}
	}
}
void chos4(){
	start();
	CoutStr("你深入了这一楼。");
	CoutStr("两旁有很多食品店，大多都是罐头食品，你决定：");
	CoutStr("A.带一点走");
	CoutStr("B.回去");
	CoutStr("C.继续向前");
	end(); 
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end2();
				Level3();
			}
			else if(ch=='B'){
				Level3();
			}
			else if(ch=='C'){
				chos5();
				chos4();
			}
		}
	}
}
void chos9();
void Get_Thing1(){
	start();
	if(thing[8]==0&&thing[4]==0){
		thing[4]=-1; 
		CoutStr("你找到了一把剑。");
		CoutStr("看上去是把玩具剑，不知为何，你想丢掉它。");
		CoutStr("A.不丢");
		thing[8]=-1;
		if(thing[7]!=2){
			CoutStr("B.丢");
		}
		else{
			CoutStr("呵呵，Angela学会用认知滤网了啊......");
		}
		if(thing[7]==0){
			CoutStr("获得成就：天命之子");
			CoutStr("条件：在没有获得B的帮助下来到这里。");
			cj[1]=1;
		}
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'){
					start();
					CoutStr("光之种剧本错误！");
					CoutStr("尝试重启！");
					CoutStr("重启失败！");
					CoutStr("启动应急预案！");
					CoutStr("......你被传回了T4。"); 
					inal(); 
					end();
					Level4();
				}
				else if(thing[7]!=2&&ch=='B'){ 
					thing[8]=0;
					danger+=3;
					start();
					CoutStr("......你被传回了T4。"); 
					inal();
					Level4();
				}
			}
		}
	}
	CoutStr("可惜，尽头什么都没有。");
	CoutStr("......你被传回了T4。"); 
	inal();
	Level4();
}
void Get_Thing2(){
	start();
	if(thing[15]==0){
		thing[15]=-1; 
		CoutStr("你找到了一个盾。");
		CoutStr("看上去是个玩具盾。"); 
		CoutStr("......你被传回了T5。"); 
		inal(); 
		end();
		Level5();
	}
	CoutStr("可惜，尽头什么都没有。");
	CoutStr("......你被传回了T5。"); 
	end();
	Level5();
}
void Get_Thing3(){
	start();
	if(thing[13]==0){
		thing[13]=-1; 
		CoutStr("你找到了一把枪。");
		CoutStr("看上去是把玩具枪。");
		CoutStr("好样的，你成功了！");
		CoutStr("B说。"); 
		inal();
		CoutStr("......你被传回了T6。"); 
		Level6();
	}
	CoutStr("可惜，这里什么都没有。");
	CoutStr("......你被传回了T6。"); 
	end();
	Level6();
}
void chos10(){
	start();
	tim+=30;
	if(tim%100>=60){
		tim+=40;
	}
	jl--;
	bsd--;
	danger++;
	CoutStr("前方有一个三叉路口。");
	CoutStr("你的直觉告诉你，选错了会有可怕的事情发生。");
	if(thing[7]==2){
		jl++;
		CoutStr("中间。");
	}
	CoutStr("A.回去");
	CoutStr("B.左边");
	CoutStr("C.中间");
	CoutStr("D.右边");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				Level4();
			}
			else if(ch=='B'){ 
				end4();
			}
			else if(ch=='C'){
				start();
				CoutStr("前方愈发黑暗。");
				CoutStr("你真的要继续走吗？");
				inal();
				Get_Thing1();
			}
			else if(ch=='D'){
				end4();
			}
		}
	}
}
void chos12(){
	start();
	CoutStr("你遇到了一扇木门。");
	CoutStr("你决定：");
	CoutStr("A.破门一脚踹了。");
	CoutStr("B.回去。");
	if(thing[7]==2){
		CoutStr("C.左转创墙。");
		CoutStr("听我的，直接穿墙，保你没事！");
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end1_2(); 
			}
			else if(ch=='B'){
				Level5();
			}
			else if(ch=='C'){
				Get_Thing2();
			}
		}
	}
} 
void chos11(){
	start();
	CoutStr("你来到了一个漆黑的走廊上。");
	CoutStr("你遇到了一个密码门。");
	CoutStr("上面显示已经试过两次错了。");
	CoutStr("第一次：1234，返回：1152");
	CoutStr("第二次：1465，返回：1097");
	CoutStr("你大胆推断答案只会是2651,1654,1534,2431中的一个，你决定：");
	CoutStr("A.破门一脚踹了。");
	CoutStr("B.回去。"); 
	CoutStr("C.2651");
	CoutStr("D.1654");
	CoutStr("E.1534");
	CoutStr("F.2431");
	end();
	jl-=2;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end1_2(); 
			}
			else if(ch=='B'){
				Level5();
			}
			else if(ch=='C'||ch=='E'||ch=='F'){
				thing[14]=0;
				end10();
			}
			else if(ch=='D'){
				if(thing[14]==-1){
					CoutStr("获得成就：数学大师");
					cj[4]=1; 
				}
				chos12();
			}
		}
	}
}
void chos9(){
	start();
	tim+=30;
	if(tim%100>=60){
		tim+=40;
	}
	jl--;
	bsd--;
	danger++;
	CoutStr("前方有一个三叉路口。");
	CoutStr("你的直觉告诉你，选错了会有可怕的事情发生。");
	if(thing[7]==2){
		jl++;
		CoutStr("左边。");
	}
	else if(thing[7]==1){
		CoutStr("友情给你个提示：左边。");
	}
	CoutStr("A.回去");
	CoutStr("B.左边");
	CoutStr("C.中间");
	CoutStr("D.右边");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				Level4();
			}
			else if(ch=='B'){
				start(); 
				CoutStr("前方愈发黑暗。");
				CoutStr("你真的要继续走吗？");
				inal();
				chos10();
			}
			else if(ch=='C'){
				end4();
			}
			else if(ch=='D'){
				end4();
			}
		}
	}
}
void chos15(){
	start();
	CoutStr("他什么都没说。");
	CoutStr("你看到了一扇门。");
	CoutStr("上面显示：请等待30分钟。");
	CoutStr("你决定等待：");
	CoutStr("A.破门一脚踹了。");
	CoutStr("B.不打扰先走了。"); 
	CoutStr("C.30分钟");
	CoutStr("D.60分钟");
	CoutStr("E.0分钟");
	CoutStr("F.45分钟");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end1_2();
			}
			else if(ch=='B'){
				danger+=4;
				Level6();
			}
			else if(ch=='C'||ch=='D'||ch=='E'){
				end10();
			}
			else if(ch=='F'){
				Get_Thing3();
			}
		}
	}
}
void chos14(){
	start();
	CoutStr("“我去！”你看到眼前的景象，当场愣住了。");
	CoutStr("眼前是人来人往的商场，与你来时没有区别。");
	CoutStr("一个游客看到了你，一脸错愕，走过来，问你：");
	CoutStr("这里不是施工区吗，你怎么出来的？");
	CoutStr("你决定回答：");
	CoutStr("A.我也不知道。");
	CoutStr("B.（沉默）"); 
	CoutStr("C.CNM!");
	CoutStr("D.啊？我不是从菜市场出来的吗？");
	if(thing[1]==-1){
		CoutStr("E.这里空间有问题，我从这出来不是很正常嘛？");
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'||ch=='B'||ch=='C'){
				if(ch=='C'&&!cj[5]){
					CoutStr("获得成就：国粹学家。");
					cj[5]=1;
					inal();
				}
				end12();
			}
			else if(ch=='D'){
				chos15();
			}
			else if(ch=='E'){
				end13();
			}
		}
	}
}
void chos13(){
	start();
	CoutStr("...");
	inal();
	CoutStr("......");
	inal();
	CoutStr(".........");
	inal();
	CoutStr("寂静无声。");
	inal();
	CoutStr("你走着走着，遇到了一扇门。");
	CoutStr("你决定：");
	CoutStr("A.破门一脚踹了。");
	CoutStr("B.回去。");
	if(thing[7]==2){
		CoutStr("C.直接走过去。");
		CoutStr("小心......人和......我没办......");
		CoutStr("时间......空间......");
		CoutStr("你隐约听到了B说的话。"); 
	}
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end1_2();
			}
			else if(ch=='B'){
				Level6();
			}
			else if(ch=='C'){
				chos14();
			}
		}
	}
}
void Level6(){
	level=6;
	start();
	CoutStr("你来到了一个未知楼层。");
	CoutStr("你决定：");
	CoutStr("A.搜寻附近。");
	CoutStr("B.看看这是几楼。");
	CoutStr("C.前往楼上。");
	CoutStr("D.看看时间。");
	end();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos13();
				Level6();
			}
			else if(ch=='B'){
				Get_Level();
				Level6();
			}
			else if(ch=='C'){
				Level5();
				break;
			}
			else if(ch=='D'){
				Get_Time();
				Level6();
			}
		}
	}
}
void Level5(){
	level=5;
	start();
	CoutStr("你来到了某个楼层。");
	CoutStr("广播里响起了警报：“脑叶公司将永久关闭！”");
	CoutStr("请立刻离开，立刻离开！");
	if(thing[7]==2){
		CoutStr("别信它，就是Angela怕了。");
	} 
	CoutStr("你决定：");
	CoutStr("A.搜寻附近。");
	CoutStr("B.看看这是几楼。");
	CoutStr("C.前往楼下。");
	CoutStr("D.前往楼上。");
	CoutStr("E.看看时间。");
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	tim+=30;
	bsd--;
	jl--;
	if(jl<=-1){
		end7();
	}
	if(bsd<=-1){
		end6();
	}
	if(bsd<=5){
		CoutStr("你快要饿死了。"); 
	}
	else if(bsd<=10){
		CoutStr("你感觉很饿。"); 
	}
	if(jl<=5){
		CoutStr("你快要累死了。");
	}
	else if(jl<=10){
		if(jl%3==0){
			danger++;
		}
		CoutStr("你累了。");
	}
	if(tim%100>=60){
		if(amlhas){
			amlhas++;
		}
		tim+=40;
	}
	if(tim/100>=24){
		tim-=2400;
		day++;
	}
	if(danger>=3){
		CoutStr("一些烦躁的情绪出现在你心里。");
		thing[9]=-1;
	}
	if(danger>=7){
		int animal=rand()%max((100-danger*5),1);
		if(animal<=5){
			CoutStr("你看见了兔子。");
			amlhas=1; 
		}
	}
	if(amlhas>=5){
		end5(); 
	}
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos11();
				Level5();
			}
			else if(ch=='B'){
				Get_Level();
				Level5();
			}
			else if(ch=='C'){
				Level6();
				break;
			}
			else if(ch=='D'){
				Level4();
				break;
			}
			else if(ch=='E'){
				Get_Time();
				Level5();
			}
		}
	}
}
void Level4(){
	start();
	level=4;
	CoutStr("你来到了某层。");
	if(thing[17]==-1){
		jl-=2;
		thing[17]=0;
		CoutStr("这里的环境十分阴森。");
		CoutStr("这一层很小，空气中弥漫着腐烂的气息。");
		CoutStr("这时，你的身边响起了一声叹息："); 
		CoutStr("看来，这一层的认知滤网失效了啊......");
		CoutStr("你现在有一句话的机会，获得他的好感。【作者提示：该选择会改变剧情的走向，请慎重选择。】");
		CoutStr("A.什么也不说。");
		CoutStr("B.你是谁？");
		CoutStr("C.你是门口的血字？");
		if(thing[5]==-1){
			CoutStr("D.你是“B”？");
			CoutStr("E.你不是死了吗？");
		}
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'||ch=='B'||ch=='C'){
					start();
					CoutStr("什么也没发生。");
					end();
					break;
				}
				else if(thing[5]==-1&&ch=='D'){
					start();
					CoutStr("你认识我？何出此言？");
					CoutStr("B 好感等级：1");
					end();
					thing[7]=1;
				}
				else if(thing[5]==-1&&ch=='E'){
					start();
					CoutStr("不错，很谨慎，你有机会出去。");
					CoutStr("B 好感等级：2");
					thing[7]=2;
					if(!cj[2]){
						CoutStr("获得成就：我就是Ayin本人");
						inal();
						cj[2]=1; 
					} 
					CoutStr("既然你对规则的把控如此熟练，我就告诉你一些事吧。");
					CoutStr("我知道你可能不信，但是听我说一句话：");
					CoutStr("A.听");
					CoutStr("B.不听");
					end();
					while(1){
						if(_kbhit()){
							char ch=_getch();
							ch=hl(ch);
							if(ch=='A'){
								start();
								CoutStr("你是外来者。");
								inal();
								CoutStr("下面是这里最核心的秘密，希望你能听。");
								CoutStr("1.这里并不是不可逃离的，我发现了逃脱的方法。那张纸条被Angela修改过。");
								CoutStr("2.Angela在T0，T0很危险，需要在T4，T5，T6分别找到一个东西，才能打败她。");
								CoutStr("3.T4的东西在我手上，可是我只剩一个灵魂了，等会听我的，我给你指路。");
								CoutStr("4.T5，T6的东西被Angela藏起来了，她会用一些“障眼法”，细心一点。"); 
								inal();
								Level4();
							}
							else if(ch=='B'){
								start();
								CoutStr("好吧，但是，不要对自己过度自信哦。");
								CoutStr("B 好感等级：1");
								end();
								thing[7]=1;
								Level4();
							}
						}
					}
				}
			}
		}
		chos9(); 
	}
	else{
		start();
		CoutStr("你决定：");
		CoutStr("A.搜寻附近。");
		CoutStr("B.看看这是几楼。");
		CoutStr("C.前往楼下。");
		CoutStr("D.前往楼上。");
		CoutStr("E.看看时间。");
		CoutStr("F.寻求帮助。");
		tim+=30;
		if(jl<=-1){
			end7();
		}
		if(bsd<=-1){
			end6();
		}
		if(bsd<=5){
			CoutStr("你快要饿死了。"); 
		}
		else if(bsd<=10){
			CoutStr("你感觉很饿。"); 
		}
		if(jl<=5){
			CoutStr("你快要累死了。");
		}
		else if(jl<=10){
			if(jl%3==0){
				danger++;
			}
			CoutStr("你累了。");
		}
		if(tim%100>=60){
			if(amlhas){
				amlhas++;
			}
			tim+=40;
		}
		if(tim/100>=24){
			tim-=2400;
			day++;
		}
		if(danger>=3){
			CoutStr("一些烦躁的情绪出现在你心里。");
			thing[9]=-1;
		}
		if(danger>=7){
			int animal=rand()%max((100-danger*5),1);
			if(animal<=5){
				CoutStr("你看见了兔子。");
				amlhas=1; 
			}
		}
		if(amlhas>=5){
			end5(); 
		}
		end();
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'){
					chos9();
					Level4();
				}
				else if(ch=='B'){
					Get_Level();
					Level4();
				}
				else if(ch=='C'){
					Level5();
					break;
				}
				else if(ch=='D'){
					Level3();
					break;
				}
				else if(ch=='E'){
					Get_Time();
					Level4();
				}
				else if(ch=='F'){
					help(4);
				} 
			}
		}
	}
}
void Level3(){
	level=3;
	start();
	CoutStr("你来到了某个楼层。这里不同于其他楼层，看上去像一个......美食街？你知道这样形容并不恰当，可你看见了两旁一大堆食品店......");
	CoutStr("你决定：");
	CoutStr("A.搜寻附近。");
	CoutStr("B.看看这是几楼。");
	CoutStr("C.前往楼下。");
	CoutStr("D.前往楼上。");
	CoutStr("E.看看时间。");
	CoutStr("F.寻求帮助。");
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	tim+=30;
	bsd--;
	jl--;
	if(jl<=-1){
		end7();
	}
	if(bsd<=-1){
		end6();
	}
	if(bsd<=5){
		CoutStr("你快要饿死了。"); 
	}
	else if(bsd<=10){
		CoutStr("你感觉很饿。"); 
	}
	if(jl<=5){
		CoutStr("你快要累死了。");
	}
	else if(jl<=10){
		if(jl%3==0){
			danger++;
		}
		CoutStr("你累了。");
	}
	if(tim%100>=60){
		if(amlhas){
			amlhas++;
		}
		tim+=40;
	}
	if(tim/100>=24){
		tim-=2400;
		day++;
	}
	if(danger>=3){
		CoutStr("一些烦躁的情绪出现在你心里。");
		thing[9]=-1;
	}
	if(danger>=7){
		int animal=rand()%max((100-danger*5),1);
		if(animal<=5){
			CoutStr("你看见了兔子。");
			amlhas=1; 
		}
	}
	if(amlhas>=5){
		end5(); 
	}
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos4();
				Level3();
			}
			else if(ch=='B'){
				Get_Level();
				Level3();
			}
			else if(ch=='C'){
				Level4();
				break;
			}
			else if(ch=='D'){
				Level2();
				break;
			}
			else if(ch=='E'){
				Get_Time();
				Level3();
			}
			else if(ch=='F'){
				help(1);
			} 
		}
	}
}
void chos2(){
	start();
	bsd--;
	jl--;
	CoutStr("纸条上写了一些东西。");
	CoutStr("欢迎游客来到IOI商场，为了您的购物体验，请遵守以下规则。");
	SetColor(Color::Red);
	CoutStr("1.请不要尝试离开商场，商场是安全的。");
	SetColor(Color::DefaultColor);
	CoutStr("2.商场内仅有6层，且分别为T1,T2,T3,T4,T5,T6，不 存 在 T 0！ "); 
	CoutStr("3.商场内可能会出现一些奇怪的现象，这种现象通常从T1至T6变多，若你感到心态崩溃，请寻找我们的工作人员帮助。");
	CoutStr("4.我们的工作人员分为3种：1.蓝衣IOI工作人员，你可以找他解决普通的问题。") ;
	CoutStr("5.我们的工作人员分为3种：2.蓝衣IOI委员会主席，你可以找他解决大部分问题，但他不喜欢被打扰，你只有2次机会。"); 
	CoutStr("6.我们的工作人员分为3种：3.红衣IOI委员会会长，你可以找他解决所有问题，但他不喜欢被打扰，你只有AK IOI(AKIOI,指去过所有楼层)才有可能获得他的帮助。");
	CoutStr("7.通常，工作人员的身份牌佩戴在胸前。若某工作人员“信息不完善”或衣服颜色不对，请勿寻求帮助。");
	CoutStr("8.商场内没有动物，若你看见了，一定是看错了，请尽快回到T2。");
	CoutStr("9.商场的食物区位于T3。");
	CoutStr("10.T1是绝对安全的。");
	CoutStr("11.商场的食物无处不在。");
	CoutStr("12.小心你的家人。");
	CoutStr("13.商场除你以外没有人。但是请与他们说话。");
	CoutStr("14.T4有一些“有趣的东西”，如果找到并带给IOI委员会会长，可能有一些奖励。");
	SetColor(Color::Red);
	CoutStr("15.想办法，这些都是...!(好像被人涂掉了)  ");
	SetColor(Color::DefaultColor);
	CoutStr("15.可以破坏公物，但要照价赔偿。");
	SetColor(Color::Red);
	CoutStr("16.1......D.......3......(好像被人涂掉了)");
	SetColor(Color::DefaultColor);
	CoutStr("纸条看完了，你注意到了纸条下渗出了一些东西，你决定：");
	CoutStr("A.撕下来。");
	CoutStr("B.进入商场。");
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end1();
				break;
			}
			else if(ch=='B'){
				CoutStr("你进入了商场。");
				system("pause"); 
				Level2();
				break;
			}
		}
	} 
}
void chos1(){
	CoutStr("A.看看吧。");
	CoutStr("B.进入商场。");
	mciSendString("pause 打字.mp3",NULL,0,NULL);
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				chos2();
				break;
			}
			else if(ch=='B'){
				Level2();
				break;
			}
		}
	} 
}
void chapter1(){
	maxchapter=max(maxchapter,1); 
	CoutStr("第一章 商场怪谈");
	cs=2;
	danger=0;
	sw=0;
	amlhas=0;
	tim=800;
	bsd=20;
	day=0;
	jl=20;
	for(int i=1;i<=13;i++){
		thing[i]=0;
	}
	for(int i=15;i<=15;i++){
		thing[i]=0;
	}
 	thing[17]=-1;
	thing[6]=-1;
	inal();
	CoutStr("商场门口贴着一张纸条。");
	CoutStr("你意识到你需要做些什么。");
	chos1();
	return ;
}
void cp2ch1();
void cp2ch2();
void cp2ch3();
void cp2ch4();
void cp2ch5();
void cp2ch6();
void cp2ch7();
void cp2ch8();
void cp2ch9();
void cp2paper1();
void cp2paper2();
void cp2paper3();
void cp2paper4();
void cp2paper2(){
	start();
	CoutStr("“你很谨慎。这是我最后一次试探。官方！我要指认他是挑战者！”售票员先对你说了一句，随后朝天大喊。");
	CoutStr("一阵沉默。");
	CoutStr("你要做点什么吗？");
	CoutStr("A.算了。");
	CoutStr("B.阻止他。"); 
	has=1;
	end();
	while(1){
 	    if(_kbhit()){
 			char ch=_getch();
 			ch=hl(ch);
 			if(ch=='A'){
 				if(!cj[8]){
				 	CoutStr("获得成就：职业外交官");
				 	cj[8]=1;
				 	inal();
				 } 
 				start();
			 	CoutStr("“恭...喜...指认成功！”天空缓缓传来这股声音。");
			 	CoutStr("那售票员喜极而泣，他已经待了500年了。");
			 	CoutStr("走之前，他给你口述了几条规则。");
			 	CoutStr("1.路必须整点走。");
			 	CoutStr("2.11:00~15:00是安全的，仅限你未违反规则时。");
			 	CoutStr("3.没路的地方有路，路要在正确的时候走。");
			 	CoutStr("4.动物园没人，动物园有人。");
			 	CoutStr("5.更衣室在门口。");
			 	CoutStr("6.正确的时间做正确的事。");
			 	aft();
			 	inal();
			 	CoutStr("听完了规则，你决定：");
			 	CoutStr("A.向前");
			 	CoutStr("B.后退至大门口");
//			 	while(){
//				 	
//				 }
			 }
			 if(ch=='B'){
			 	end22();
			 }
 		}
 	}
}
void cp2ch6(){
	start();
	CoutStr("售票员如释重负:“啊，终于有人来了！”随后跌倒在地。");
	CoutStr("你连忙扶起他，问他怎么了。");
	CoutStr("他告诉你，他是上一任挑战者，死亡后被发配到这里当售票员。");
	CoutStr("直到下一个挑战者到来，且他成功识别，他才能解放。如果错误，则永世都要留在这里。");
	inal();
	CoutStr("“小伙子，”售票员说，“我知道你肯定在想为什么我要刁难你，你照照镜子就知道了。”");
	CoutStr("你拿起镜子，你一看镜子中的你，人都傻了，因为镜子里的你明明不是人！");
	CoutStr("随后，那售票员递给你一个东西，说是涂了就没事了，你接了过来，决定：");
	CoutStr("A.涂");
	CoutStr("B.不涂");
	end();
	 while(1){
 		if(_kbhit()){
 			char ch=_getch();
 			ch=hl(ch);
 			if(ch=='A'){
			 	end21();
			 }
			 if(ch=='B'){
			 	cp2paper2();
			 }
 		}
 	}
}
void cp2ch5(){
	start();
	CoutStr("你又回到了售票员所在的地方。");
	CoutStr("售票员看到你，气不打一处来，对你说：“lz都放你走了，你还想干啥？”");
	CoutStr("你也许需要说点什么。");
	CoutStr("特殊：双重选择：选择前缀与后缀，用两个字母表示。");
	CoutStr("前缀A:你");
	CoutStr("前缀B:我");
	CoutStr("前缀C:我们");
	CoutStr("后缀A.是人。");
	CoutStr("后缀B.是动物。");
	CoutStr("后缀C.是人也是动物。");
	CoutStr("后缀D.不是人也不是动物。");
	end();
	int wrong=0;
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'||ch=='C'){
				cout<<ch;
				wrong=1;
				break;
			}
			else if(ch=='B'){
				cout<<ch;
				break;
			}
		}
	}
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='B'||ch=='C'||ch=='D'){
				cout<<ch;
				wrong=1;
				break;
			}
			else if(ch=='A'){
				cout<<ch;
				break;
			}
		}
	}
	if(wrong==0){
		CoutStr("“你是人类？我凭什么相信你？”售票员有一瞬间的震惊，但很快平静下来。");
		CoutStr("快，再说点什么！");
		CoutStr("A.那么，你是人类吗？");
		CoutStr("B.我如果不是人，你早死了。");
		CoutStr("C.(沉默)");
		CoutStr("D.我能看见规则。");
		CoutStr("E.我是在浓雾中被传进来的。");
		while(1){
			if(_kbhit()){
				char ch=_getch();
				ch=hl(ch);
				if(ch=='A'||ch=='B'||ch=='C'||ch=='D'){
					end20();
				}
				else if(ch=='E'){
					cp2ch6();
				}
			}
		}
	}
	else{
		CoutStr("“你想表达什么？”售票员不解地看向你，你被迫回到路口。");
		cp2ch4(); 
	} 
}
void cp2ch4(){
	CoutStr("你面前出现了两条路。");
	CoutStr("左边的路写着：人走的。");
	CoutStr("右边的路写着：动物走的。");
	CoutStr("你决定：");
	CoutStr("A.走左边");
	CoutStr("B.走中间");
	CoutStr("C.走右边");
	CoutStr("D.回头");
	CoutStr("E.原地不动");
	aft();
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end19();
			}
			else if(ch=='B'){
				CoutStr("明知没路你还走，这不找死吗？");
				inal();
				end19();
			}
			else if(ch=='C'){
				end19();
			}
			else if(ch=='D'){
				if(has){
					CoutStr("你无法后退了。");
					cp2ch4();
				}
				cp2ch5();
			}
			else if(ch=='E'){
				cp2ch4();
			}
		}
	}
}
void cp2ch3(){
	start();
	CoutStr("售票员脸色好看了点，对你说：“票给你，快给劳资滚！”");
	CoutStr("你离开了售票口。");
	CoutStr("现在，真正的考验开始了。");
	CoutStr("Tip:本章难度较高，甚至大于第三章，如对通关方法有疑问，请询问作者@zjw806903，谢谢。"); 
	inal();
	cp2ch4();
}
void cp2ch2(){
	start();
	CoutStr("你对着售票员笑了一个，随后往前走了一步。"); 
	CoutStr("“你笑尼玛呢？lz天天工作，你还笑，我CNM!”售票员对你说。"); 
	CoutStr("你决定：");
	CoutStr("A.不笑了。");
	CoutStr("B.继续笑。");
	CoutStr("C.你怎么能说脏话呢？这是不对的！");
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				cp2ch3();
				break;
			}
			else if(ch=='B'){
				end16();
				break;
			}
			else if(ch=='C'){
				end18();
			}
		}
	} 
} 
void cp2ch1(){
	CoutStr("你眼前突然出现了一个售票口。");
	CoutStr("为了获得票，你决定：");
	CoutStr("A.您好，请问可以给我一张票吗？");
	CoutStr("B.给他钱。");
	CoutStr("C.给他一巴掌。");
	if(thing[1]){
		CoutStr("D.给他笑一个。"); 
	}
	while(1){
		if(_kbhit()){
			char ch=_getch();
			ch=hl(ch);
			if(ch=='A'){
				end16();
				break;
			}
			else if(ch=='B'){
				end16();
				break;
			}
			else if(ch=='C'){
				if(ch=='C'&&!cj[5]){
					CoutStr("获得成就：国粹学家。");
					cj[5]=1;
					inal();
				}
				end17();
			}
			else if(ch=='D'&&thing[1]){
				cp2ch2();
			} 
		}
	} 
}
void check(){
	start();
	CoutStr("特殊玩法：规则解密。");
	CoutStr("请输入关键二字词，解密后将获得一些信息。（五次机会）");
	CoutStr("解密或许有利于后面的选择。");
	inal();
	for(int i=1;i<=5;i++){
		start();
		string str;
		CoutStr("请输入关键词。");
		cin>>str;
		if(str=="一定"){
			thing[1]=1;
			CoutStr("这也许......也是规则的一部分？");
		}
		if(str=="所有"){
			CoutStr("所有......人也算动物吧？");
		}
		if(str=="杀人"){
			CoutStr("万一......杀的不是人呢？毕竟......人也算动物，是吧？");
		}
		if(str=="没有"){
			CoutStr("动物园没有，假如......这里根本就不是动物园呢？");
		}
		inal();
	}
	cp2ch1();
}
void cp2paper1(){
	CoutStr("规则漂浮在你身前。");
	CoutStr("动物园规则：");
	CoutStr("欢迎游客来到全市最大的动物园！");
	CoutStr("我们拥有全市的所有动物！任你观赏！");
	CoutStr("相信您在游览过程中，一定会全程带着微笑！");
	CoutStr("但是，为了您有一个愉快的游览过程，请遵守本规则：");
	CoutStr("1.动物园没有兔子。");
	CoutStr("2.必要时刻，你可以牺牲任何动物。");
	CoutStr("3.不能杀人。");
	CoutStr("4.本动物园没有海洋馆。");
	SetColor(Color::Red);
	CoutStr("5.请保证你是人，无论外貌或是心里。");
	SetColor(Color::DefaultColor);
	CoutStr("6.狮子只有4头，如果您发现了5头，请请求工作人员帮助。");
	CoutStr("7.当你遇到无法解决的问题时，请向天空大声喊：“帮帮我，伟大的作者先生！”");
	SetColor(Color::Red);
	CoutStr("8.你只有1次机会。"); 
	SetColor(Color::DefaultColor);
	CoutStr("9.本动物园不出售与动物有关的任何东西。");
	SetColor(Color::Red);
	CoutStr("10.终焉时......"); 
	SetColor(Color::DefaultColor);
	inal();
	CoutStr("你看完了规则。");
	CoutStr("不知何时，大门已经在你身后了。");
	CoutStr("想办法离开这里，或是......");
	CoutStr("找出这里隐藏的真相。");
	inal();
	check(); 
}
void chapter2(){
	maxchapter=max(maxchapter,2); 
	memset(thing,0,sizeof(thing));
	danger=0;
	sw=0;
	has=0;
	tim=800;
	bsd=20;
	day=0;
	jl=20;
	CoutStr("第二章 动物园怪谈");
	inal();
	CoutStr("你来到了一个动物园门口。");
	CoutStr("常年看规则怪谈的的你十分熟悉这个怪谈。");
	CoutStr("你认为这是来送分的。");
	inal(); 
	CoutStr("但......");
	Sleep(9000); 
	inal();
	CoutStr("真的是这样吗？");
	inal();
	cp2paper1();
	return ;
}
int main(void){
	cout<<"这个游戏我整整花了3天，点个关注不过分吧" ; 
	thing[14]=-1;
	srand(time(0));
	chapter0();
	return 0;
}
